<?php
	include 'business/model/model.php';
	include 'business/dao/BaseDataAccess.php';
	include 'business/dao/ResourceAccess.php';
	ini_set('display_errors',1);
	
	$resourceDao = new ResourceDao();
	if (isset($_GET['id'])) {
		$resource = $resourceDao->getResource($_GET['id']);
		$type = $resource->getFileType();
		header("Content-type:$type");
		echo $resource->getData();
	}
?>